package com.ruoyi.purchase.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Data;

/**
 * 
 * @TableName po_detail
 */
@TableName(value ="po_detail")
@Data
public class PoDetail implements Serializable {
    /**
     * 采购明细id
     */
    @TableId(type = IdType.AUTO)
    private Integer detailId;

    /**
     * 采购单编号 id外键
     */
    private String poPurId;

    /**
     * 商品id 外键
     */
    private Integer poProductId;

    /**
     * 进价
     */
    private Double buyPrice;

    /**
     * 数量
     */
    private Integer num;

    /**
     * 总金额
     */
    private Double total;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        PoDetail other = (PoDetail) that;
        return (this.getDetailId() == null ? other.getDetailId() == null : this.getDetailId().equals(other.getDetailId()))
            && (this.getPoPurId() == null ? other.getPoPurId() == null : this.getPoPurId().equals(other.getPoPurId()))
            && (this.getPoProductId() == null ? other.getPoProductId() == null : this.getPoProductId().equals(other.getPoProductId()))
            && (this.getBuyPrice() == null ? other.getBuyPrice() == null : this.getBuyPrice().equals(other.getBuyPrice()))
            && (this.getNum() == null ? other.getNum() == null : this.getNum().equals(other.getNum()))
            && (this.getTotal() == null ? other.getTotal() == null : this.getTotal().equals(other.getTotal()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getDetailId() == null) ? 0 : getDetailId().hashCode());
        result = prime * result + ((getPoPurId() == null) ? 0 : getPoPurId().hashCode());
        result = prime * result + ((getPoProductId() == null) ? 0 : getPoProductId().hashCode());
        result = prime * result + ((getBuyPrice() == null) ? 0 : getBuyPrice().hashCode());
        result = prime * result + ((getNum() == null) ? 0 : getNum().hashCode());
        result = prime * result + ((getTotal() == null) ? 0 : getTotal().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", detailId=").append(detailId);
        sb.append(", poPurId=").append(poPurId);
        sb.append(", poProductId=").append(poProductId);
        sb.append(", buyPrice=").append(buyPrice);
        sb.append(", num=").append(num);
        sb.append(", total=").append(total);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}